package com.tuo51.evaluate.repositories.appusers;

import com.tuo51.evaluate.domain.appusers.PayOrder;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PayOrderRepository extends JpaRepository<PayOrder, Long>, JpaSpecificationExecutor<PayOrder> {

//    @Query(value = "select o.*, vip.name as 'productName' from pay_order o left join vip on vip.id = o.product_id where o.user_id = :userId", nativeQuery = true)
    List<PayOrder> findAllByUserIdOrderByCreateTimeDesc(@Param("userId") String userId);

}
